﻿using CoreApi.Meta;
using CoreService.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;

namespace CoreService.Controllers
{
    public abstract class BaseWechatController:BaseController
    {

        private ReturnValue CheckWechatUnionId(string wetchatUnionId)
        {
            if (wetchatUnionId == null || wetchatUnionId.Equals(string.Empty)) return new ReturnValue(false,"Wechat.UnionId.Missing");
            return new ReturnValue();
        }

        protected ReturnValue CheckWechatRequest(WechatBaseRequest request)
        {
            ReturnValue rv=CheckRequest(request);
            if (!rv.Passed) return rv;
            return CheckWechatUnionId(request.WechatUnionId);
        }

    }
}